package org.sanguine.tests.tenderpro.sax;

import org.sanguine.tests.tenderpro.sax.actions.Action;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created with IntelliJ IDEA.
 * Author: Alexey Kuznetsov
 * Date: 23.02.14
 * Time: 13:24
 * SVN $Id$
 */
public class PassThroughHandler implements InvocationHandler {
    private Object action;
    public PassThroughHandler(Action a) {
        action = a;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (action != null) return method.invoke(action, args);
        return null;
    }
}
